package com.camemax.utils;

import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

public class StreamEnvUtils {

    private StreamEnvUtils(){}

    public static StreamExecutionEnvironment getStreamEnv(){
        int cpuCores = Runtime.getRuntime().availableProcessors();
        return getStreamEnv(cpuCores);
    }

    public static StreamExecutionEnvironment getStreamEnv(int parallel){
        return StreamExecutionEnvironment.getExecutionEnvironment().setParallelism(parallel);
    }
}
